<script setup lang="ts">
import { ref, toRefs } from 'vue'

const user = ref({
  name: 'zs',
  age: 18,
})

const { name, age } = toRefs(user.value)

console.log(name)
console.log(age)
</script>

<template>
  <h1>{{ user }}</h1>
  <h2>name:{{ name }}</h2>
  <h2>age:{{ age }}</h2>
  <button @click="user.age++">点击年龄+1</button>
</template>
